package cn.edu.cqytxy;

/**
 * @Author：XinliChen
 *
 * @Date:2025/03/
 */
public class switchDemo {
    public static void main(String[] args) {
        System.out.println("请输入对应的年份、月份、日期");
        int sum = 0,year=0,month=0,day=0;

        switch (month){
            case 1: sum += day;break;
            case 2: sum += 31 + day;break;
            case 3: sum += 31+isR(year) + day;break;
            case 4: sum += 31+isR(year)+31 + day;break;
            case 5: sum += 30+31+isR(year)+31 + day;break;
            case 6: sum += 31+30+31+isR(year)+31 + day;break;
            case 7: sum += 30+31+30+31+isR(year)+31 + day;break;
            case 8: sum += 31+30+31+30+31+isR(year)+31 + day;break;
            case 9: sum += 30+31+30+31+30+31+isR(year)+31 + day;break;
            case 10: sum += 31+30+31+30+31+30+31+isR(year)+31 + day;break;
            case 11: sum += 30+31+30+31+30+31+30+31+isR(year)+31 + day;break;
            case 12: sum += 31+30+31+30+31+30+31+30+31+isR(year)+31 + day;break;
        }
    }

    /**
     *
     * @param year 参数
     *
     * @return返回二月的天数
     *
     */

    public static int isR(int year) {
        if((year % 400 == 0) || (year % 4 == 0 && year % 100 != 0)){
        return 29;
    }
    return 28;
    }
}
